//
//  GYNetWorkTools.h
//  Visitor
//
//  Created by x on 2017/9/28.
//  Copyright © 2017年 HLB. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

/** 请求成功block */
typedef void (^SuccessCallBack)(NSDictionary *obj);

/** 请求失败的block */
typedef void(^ErrorCallBlck)(NSError *error);

/** 返回图片的block */
typedef void(^ReturnImage)(UIImage *image);

@interface GYNetWorkTools : NSObject

/**
 用户登入

 @param userName 用户名
 @param pwd 用户密码
 @param successCallBack 登入成功的回调
 @param errorCallBack 登入失败的回调
 
 */
+ (void)loginWithUser:(NSString *)userName PassWord:(NSString *)pwd Success:(SuccessCallBack)successCallBack Filed:(ErrorCallBlck)errorCallBack;

/**
 加载访客记录数据

 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)loadVisitorData:(SuccessCallBack)successCallBack filed:(ErrorCallBlck)errorCallBack;

/**
 处理访客请求

 @param requestKey <#requestKey description#>
 @param operationCode <#operationCode description#>
 @param visitorId <#visitorId description#>
 @param cause <#cause description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)handleVisitorRequest:(NSString *)requestKey operationCode:(NSString *)operationCode visitorId:(NSString *)visitorId cause:(NSString *)cause susscess:(SuccessCallBack)successCallBack filed:(ErrorCallBlck)errorCallBack;

/**
 退出登入

 @param requestKey <#requestKey description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)loginOut:(NSString *)requestKey susscess:(SuccessCallBack)successCallBack filed:(ErrorCallBlck)errorCallBack;

/**
 上传deviceToken给服务器

 @param deviceToken <#deviceToken description#>
 @param requestKey <#requestKey description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)uploadDeviceToken:(NSString *)deviceToken requestKey:(NSString *)requestKey susscess:(SuccessCallBack)successCallBack filed:(ErrorCallBlck)errorCallBack;


/**
 获取访客记录的图片

 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)loadVisitorfaceimagebase:(NSString *)faceimagebase susscess:(ReturnImage)successCallBack filed:(ErrorCallBlck)errorCallBack;


/**
 加载个人信息
 */
+ (void)loadUserInfo:(SuccessCallBack)successCallBack filed:(ErrorCallBlck)errorCallBack;;

@end
